<?php

/**
 * @copyright   FOSP
 * @version     20120412
 * @todo        Format data player
 * @name        Fpt_Business_Player_Metadata_Player
 * @author      QuangTM 
 */
class Fpt_Business_Player_Metadata_Player
{

    /**
     *
     * @var int
     */
    private $_id;

    /**
     *
     * @var string
     */
    private $_name;

    /**
     *
     * @var string
     */
    private $_image;

    /**
     *
     * @var string
     */
    private $_birthday;

    /**
     *
     * @var string
     */
    private $_nationality;

    /**
     *
     * @var string
     */
    private $_height;

    public function __construct()
    {
        $this->_birthday = '';
        $this->_height = '';
        $this->_id = 0;
        $this->_image = '';
        $this->_name = '';
        $this->_nationality = '';
    }

    /**
     * Initialize data
     * @param arary $entity
     * @return Fpt_Business_Player_Metadata_Player 
     * @author QuangTM
     */
    public function init($entity)
    {
        $this->_birthday = isset($entity['birthday']) ? $entity['birthday'] : NULL;
        $this->_height = isset($entity['height']) ? $entity['height'] : NULL;
        $this->_id = isset($entity['player_id']) ? intval($entity['player_id']) : 0;
        ;
        $this->_image = isset($entity['image']) ? $entity['image'] : NULL;
        $this->_name = isset($entity['name']) ? $entity['name'] : NULL;
        $this->_nationality = isset($entity['nationality']) ? $entity['nationality'] : NULL;
        return $this;
    }

    /**
     * Get basic data player
     * @return array
     * @author QuangTM 
     */
    public function getBasicData()
    {
        return array(
            'ID'    => $this->_id,
            'Name'  => $this->_name,
            'Image' => $this->_image,
        );
    }
    
    /**
     * Get full data player
     * @return array
     * @author QuangTM
     */
    public function getFullData()
    {
        return array(
            'ID'          => $this->_id,
            'Name'        => $this->_name,
            'Image'       => $this->_image,
            'Birthday'    => $this->_birthday,
            'Nationality' => $this->_nationality,
            'Height'      => $this->_height
        );
    }

}